using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class GetPSMImgResponse : GeneratedMessageLite<GetPSMImgResponse, GetPSMImgResponse.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<GetPSMImgResponse, GetPSMImgResponse.Builder>
		{
			private bool resultIsReadOnly;
			private GetPSMImgResponse result;
			protected override GetPSMImgResponse.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override GetPSMImgResponse MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override GetPSMImgResponse DefaultInstanceForType
			{
				get
				{
					return GetPSMImgResponse.DefaultInstance;
				}
			}
			public BaseResponse BaseResponse
			{
				get
				{
					return this.result.BaseResponse;
				}
				set
				{
					this.SetBaseResponse(value);
				}
			}
			public SKBuiltinBuffer_t Data
			{
				get
				{
					return this.result.Data;
				}
				set
				{
					this.SetData(value);
				}
			}
			public uint TotalLength
			{
				get
				{
					return this.result.TotalLength;
				}
				set
				{
					this.SetTotalLength(value);
				}
			}
			public Builder()
			{
				this.result = GetPSMImgResponse.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(GetPSMImgResponse cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private GetPSMImgResponse PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					GetPSMImgResponse other = this.result;
					this.result = new GetPSMImgResponse();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override GetPSMImgResponse.Builder Clear()
			{
				this.result = GetPSMImgResponse.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override GetPSMImgResponse.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new GetPSMImgResponse.Builder(this.result);
				}
				return new GetPSMImgResponse.Builder().MergeFrom(this.result);
			}
			public override GetPSMImgResponse BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override GetPSMImgResponse.Builder MergeFrom(IMessageLite other)
			{
				if (other is GetPSMImgResponse)
				{
					return this.MergeFrom((GetPSMImgResponse)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override GetPSMImgResponse.Builder MergeFrom(GetPSMImgResponse other)
			{
				return this;
			}
			public override GetPSMImgResponse.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override GetPSMImgResponse.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(GetPSMImgResponse._getPSMImgResponseFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = GetPSMImgResponse._getPSMImgResponseFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 10u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 10u)
						{
							BaseResponse.Builder builder = BaseResponse.CreateBuilder();
							if (this.result.hasBaseResponse)
							{
								builder.MergeFrom(this.BaseResponse);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.BaseResponse = builder.BuildPartial();
							continue;
						}
					}
					else
					{
						if (num3 == 18u)
						{
							SKBuiltinBuffer_t.Builder builder2 = SKBuiltinBuffer_t.CreateBuilder();
							if (this.result.hasData)
							{
								builder2.MergeFrom(this.Data);
							}
							input.ReadMessage(builder2, extensionRegistry);
							this.Data = builder2.BuildPartial();
							continue;
						}
						if (num3 == 24u)
						{
							this.result.hasTotalLength = input.ReadUInt32(ref this.result.totalLength_);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public GetPSMImgResponse.Builder SetBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = value;
				return this;
			}
			public GetPSMImgResponse.Builder SetBaseResponse(BaseResponse.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasBaseResponse = true;
				this.result.baseResponse_ = builderForValue.Build();
				return this;
			}
			public GetPSMImgResponse.Builder MergeBaseResponse(BaseResponse value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasBaseResponse && this.result.baseResponse_ != BaseResponse.DefaultInstance)
				{
					this.result.baseResponse_ = BaseResponse.CreateBuilder(this.result.baseResponse_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.baseResponse_ = value;
				}
				this.result.hasBaseResponse = true;
				return this;
			}
			public GetPSMImgResponse.Builder ClearBaseResponse()
			{
				this.PrepareBuilder();
				this.result.hasBaseResponse = false;
				this.result.baseResponse_ = null;
				return this;
			}
			public GetPSMImgResponse.Builder SetData(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasData = true;
				this.result.data_ = value;
				return this;
			}
			public GetPSMImgResponse.Builder SetData(SKBuiltinBuffer_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasData = true;
				this.result.data_ = builderForValue.Build();
				return this;
			}
			public GetPSMImgResponse.Builder MergeData(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasData && this.result.data_ != SKBuiltinBuffer_t.DefaultInstance)
				{
					this.result.data_ = SKBuiltinBuffer_t.CreateBuilder(this.result.data_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.data_ = value;
				}
				this.result.hasData = true;
				return this;
			}
			public GetPSMImgResponse.Builder ClearData()
			{
				this.PrepareBuilder();
				this.result.hasData = false;
				this.result.data_ = null;
				return this;
			}
			public GetPSMImgResponse.Builder SetTotalLength(uint value)
			{
				this.PrepareBuilder();
				this.result.hasTotalLength = true;
				this.result.totalLength_ = value;
				return this;
			}
			public GetPSMImgResponse.Builder ClearTotalLength()
			{
				this.PrepareBuilder();
				this.result.hasTotalLength = false;
				this.result.totalLength_ = 0u;
				return this;
			}
		}
		public const int BaseResponseFieldNumber = 1;
		public const int DataFieldNumber = 2;
		public const int TotalLengthFieldNumber = 3;
		private static readonly GetPSMImgResponse defaultInstance;
		private static readonly string[] _getPSMImgResponseFieldNames;
		private static readonly uint[] _getPSMImgResponseFieldTags;
		private bool hasBaseResponse;
		private BaseResponse baseResponse_;
		private bool hasData;
		private SKBuiltinBuffer_t data_;
		private bool hasTotalLength;
		private uint totalLength_;
		private int memoizedSerializedSize = -1;
		public static GetPSMImgResponse DefaultInstance
		{
			get
			{
				return GetPSMImgResponse.defaultInstance;
			}
		}
		public override GetPSMImgResponse DefaultInstanceForType
		{
			get
			{
				return GetPSMImgResponse.DefaultInstance;
			}
		}
		protected override GetPSMImgResponse ThisMessage
		{
			get
			{
				return this;
			}
		}
		public BaseResponse BaseResponse
		{
			get
			{
				return this.baseResponse_ ?? BaseResponse.DefaultInstance;
			}
		}
		public SKBuiltinBuffer_t Data
		{
			get
			{
				return this.data_ ?? SKBuiltinBuffer_t.DefaultInstance;
			}
		}
		public uint TotalLength
		{
			get
			{
				return this.totalLength_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasBaseResponse && this.hasData && this.hasTotalLength && this.BaseResponse.IsInitialized && this.Data.IsInitialized;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasBaseResponse)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.BaseResponse);
				}
				if (this.hasData)
				{
					num += CodedOutputStream.ComputeMessageSize(2, this.Data);
				}
				if (this.hasTotalLength)
				{
					num += CodedOutputStream.ComputeUInt32Size(3, this.TotalLength);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private GetPSMImgResponse()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] getPSMImgResponseFieldNames = GetPSMImgResponse._getPSMImgResponseFieldNames;
			if (this.hasBaseResponse)
			{
				output.WriteMessage(1, getPSMImgResponseFieldNames[0], this.BaseResponse);
			}
			if (this.hasData)
			{
				output.WriteMessage(2, getPSMImgResponseFieldNames[1], this.Data);
			}
			if (this.hasTotalLength)
			{
				output.WriteUInt32(3, getPSMImgResponseFieldNames[2], this.TotalLength);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasBaseResponse)
			{
				num ^= this.baseResponse_.GetHashCode();
			}
			if (this.hasData)
			{
				num ^= this.data_.GetHashCode();
			}
			if (this.hasTotalLength)
			{
				num ^= this.totalLength_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object value)
		{
			GetPSMImgResponse getPSMImgResponse = value as GetPSMImgResponse;
			return getPSMImgResponse != null && (this.hasBaseResponse == getPSMImgResponse.hasBaseResponse && (!this.hasBaseResponse || this.baseResponse_.Equals(getPSMImgResponse.baseResponse_))) && (this.hasData == getPSMImgResponse.hasData && (!this.hasData || this.data_.Equals(getPSMImgResponse.data_))) && (this.hasTotalLength == getPSMImgResponse.hasTotalLength && (!this.hasTotalLength || this.totalLength_.Equals(getPSMImgResponse.totalLength_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<GetPSMImgResponse, GetPSMImgResponse.Builder>.PrintField("BaseResponse", this.hasBaseResponse, this.baseResponse_, writer);
			GeneratedMessageLite<GetPSMImgResponse, GetPSMImgResponse.Builder>.PrintField("Data", this.hasData, this.data_, writer);
			GeneratedMessageLite<GetPSMImgResponse, GetPSMImgResponse.Builder>.PrintField("TotalLength", this.hasTotalLength, this.totalLength_, writer);
		}
		public static GetPSMImgResponse ParseFrom(byte[] data)
		{
			return GetPSMImgResponse.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private GetPSMImgResponse MakeReadOnly()
		{
			return this;
		}
		public static GetPSMImgResponse.Builder CreateBuilder()
		{
			return new GetPSMImgResponse.Builder();
		}
		public override GetPSMImgResponse.Builder ToBuilder()
		{
			return GetPSMImgResponse.CreateBuilder(this);
		}
		public override GetPSMImgResponse.Builder CreateBuilderForType()
		{
			return new GetPSMImgResponse.Builder();
		}
		public static GetPSMImgResponse.Builder CreateBuilder(GetPSMImgResponse prototype)
		{
			return new GetPSMImgResponse.Builder(prototype);
		}
		static GetPSMImgResponse()
		{
			GetPSMImgResponse.defaultInstance = new GetPSMImgResponse().MakeReadOnly();
			GetPSMImgResponse._getPSMImgResponseFieldNames = new string[]
			{
				"BaseResponse",
				"Data",
				"TotalLength"
			};
			GetPSMImgResponse._getPSMImgResponseFieldTags = new uint[]
			{
				10u,
				18u,
				24u
			};
			object.ReferenceEquals(micromsg.Proto.GetPSMImgResponse.Descriptor, null);
		}
	}
}
